package com.ethink.warehouse.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.warehouse.api.info.LogisticsTransferOrderInfo;
import com.ethink.warehouse.common.entity.LogisticsTransferOrder;

/**
 * 物流调拨单 Converter转换器
 *
 * @author default
 * @date 2022-11-10
 */
@Component
public class LogisticsTransferOrderConverter implements Converter<LogisticsTransferOrderInfo, LogisticsTransferOrder> {

    @Override
    public LogisticsTransferOrder convertTo(LogisticsTransferOrderInfo info) {
        if(info == null) {
            return null;
        }
        LogisticsTransferOrder entity = new LogisticsTransferOrder ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public LogisticsTransferOrderInfo convertFrom(LogisticsTransferOrder entity) {
        if(entity == null) {
            return null;
        }
        LogisticsTransferOrderInfo info = new LogisticsTransferOrderInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
